package com.spdg.ring.common;

import com.spdg.ring.R;

import android.content.Context;
import cn.wolf.tools.SdCardTool;

public class Config {

	private static boolean init_success = false;

	public static void system_init(Context context) {
		if (!init_success) {
			init_success = true;
			CONSUMER_KEY = context.getString(R.string.config_consumer_key);
			REDIRECT_URL = context.getString(R.string.config_redirect_url);
			
			SDCARD_ROOT_DIR = SdCardTool.getSdcardDir() + context.getString(R.string.config_sdcard_root_dir);
			SDCARD_LOG_DIR = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_log_dir);
			SDCARD_MENU_DIR = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_menu_dir);
			SDCARD_ARTICLE_PIC = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_article_pic_dir);
			SDCARD_OFFLINE_PACKAGE = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_offline_package);
			SDCARD_OFFLINE_ARTICLE_LIST_TEMP = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_offline_article_list_temp);
			SDCARD_OFFLINE_ARTICLE_PAGE_TEMP = SDCARD_ROOT_DIR + context.getString(R.string.config_sdcard_offline_article_page_temp);
			
			URL.URL_MENU_CONFIG = context.getString(R.string.url_menu_config);
			URL.URL_CHECK_UPDATE = context.getString(R.string.url_check_update);
			URL.URL_NOTIFICATION = context.getString(R.string.url_notification);
			URL.URL_RECORD_CHANNEL = context.getString(R.string.url_record_channel);
		}
	}
	
	public static boolean initSuccess() {
		return init_success;
	}

	// 新浪微博配置
	public static String CONSUMER_KEY = "360321835";// 需要替换为应用的KEY
	public static String REDIRECT_URL = "http://www.appspost.net";

	// 绕圈圈配置
	public static String SDCARD_ROOT_DIR = SdCardTool.getSdcardDir() + "/korea/"; // sd卡根目录
	public static String SDCARD_LOG_DIR = SDCARD_ROOT_DIR + "/log/"; // 异常日志
	public static String SDCARD_MENU_DIR = SDCARD_ROOT_DIR + "/image/menu/"; // sd卡菜单图片路径
	public static String SDCARD_ARTICLE_PIC = SDCARD_ROOT_DIR + "/image/article/"; // 文章图片(包括详细页面和列表)
	public static String SDCARD_OFFLINE_PACKAGE = SDCARD_ROOT_DIR + "/offline/"; // 离线包存放地址
	public static String SDCARD_OFFLINE_ARTICLE_LIST_TEMP = SDCARD_ROOT_DIR
			+ "/offline/temp/article_list/"; // 临时目录(存放列表和详细数据)
	public static String SDCARD_OFFLINE_ARTICLE_PAGE_TEMP = SDCARD_ROOT_DIR
			+ "/offline/temp/article_page/"; // 临时目录(存放列表和详细数据)

	// 离线包文件名
	public static final String OFFLINE_RING_LIST = "ring_list"; // 文章列表文件夹
	public static final String OFFLINE_RING_PAGE = "ring_page"; // 文章详细页文件夹
	public static final String OFFLINE_RING_PIC = "ring_pic"; // 图片

	public static class URL {
		public static String URL_MENU_CONFIG = "http://newappsandroid.appscomb.cn/op/turnfuzhou_index";
		public static String URL_NOTIFICATION = "http://apkconnector.appscomb.cn/op/getpush?device="; // 消息推送
		public static String URL_RECORD_CHANNEL = "http://apkconnector.appscomb.cn/op/softregister?"; // 系统消息注册
		public static String URL_CHECK_UPDATE = "http://apkconnector.appscomb.cn/op/softupdate?"; // 检查更新
	}

}
